<?php
session_start();
include("connexion.php");
include('menu.php');

$query = "SELECT * FROM user WHERE user_id = ".$_SESSION['user_id']." ";
$userList = mysqli_query($connexion, $query);


if (isset($_POST['modifier'])) {

		$user_nom = $_POST['nom'];
		$user_prenom = $_POST['prenom'];
		$user_mail = $_POST['email'];
		$user_pwd = $_POST['pwd'];
		$user_pwd2 = $_POST['pwd2'];

	if ($user_pwd == $user_pwd2) {
	
		$query = "UPDATE user SET user_prenom = '$user_prenom', user_nom = '$user_nom', user_mail = '$user_mail', user_pwd = '$user_pwd' WHERE user_id = ".$_SESSION['user_id']." ";
		$res = mysqli_query($connexion, $query);
		header('location:profil.php');
	}
}

include ("profil_edit.html");

?>
